#!/usr/bin/env bash
# Compare current branch with master to see if there are changes in the docs/
# folder
set -x

# Remote urls are not always set on Netlify
git remote set-url origin https://github.com/algolia/docsearch.git
git fetch

CHANGES_IN_DOCS="$(git diff --name-only origin/master | grep '^docs/')"
if [ "$CHANGES_IN_DOCS" = "" ]; then
  exit 1
fi
exit 0

